function [sel, lmode] = notecontrol(pathflag)
% dispatch data display based on clicks on the notefile list
global CONTROL
sel=[];
lmode = 1; % flag for detected click mode - 1 for "open", 0 for "normal"

htag = findobj('Tag', 'datac_main');
if(~ishandle(htag))
   error('notecontrol: Unable to find datac_main')
   return;
end;

s=get(htag, 'SelectionType');
if(isempty(CONTROL)) 
   QueMessage('[Listcontrol] No user data (CONTROL is empty)? ')
   return
else
   nsf = size(ctlt);
end
h2 = findobj('Tag', 'Path');
path = get(h2, 'String');
% display(sprintf('listcontrol: s=%s', s));
switch (s)
case 'open'
   h2=findobj('Tag', 'CTL');
   sel = get(h2, 'Value');
	lmode = 1;
otherwise
	lmode = 0;
end
return;
